import React, { Component } from 'react'
import { withRouter } from 'react-router-dom'

export class List extends Component {
  render() {
      const {newarr}=this.props
    return (
      <div>
          {newarr.length?newarr.map((item)=>{
              return <li
              key={item.id}
              onClick={()=>{
                  this.props.history.push('/xiang/'+item.id)
              }}
              >
                  <img src={item.img} alt="" />
                  <p> <span>{item.da}回答</span>
                <span>{item.du}阅读</span>
                <span>{item.title}</span>
                <span>{item.name}</span></p>
                 
              </li>
          }):'暂无数据'}
      </div>
    )
  }
}

export default withRouter(List)